package com.nbsaas.boot.wms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "出库单明细", model = "出库单明细")
@Entity
@Table(name = "bs_stock_out_order_item")
@Comment("出库单明细表")
public class StockOutOrderItem extends AbstractEntity {

    @Comment("出库单ID")
    @FormField(title = "出库单ID", sortNum = "1", grid = true, required = true)
    private Long stockOutOrderId;

    @Comment("商品ID")
    @FormField(title = "商品ID", sortNum = "2", grid = true, required = true)
    private Long productId;

    @Comment("SKU ID")
    @FormField(title = "SKU ID", sortNum = "3", grid = true, required = true)
    private Long skuId;

    @Comment("货位ID")
    @FormField(title = "货位ID", sortNum = "4", grid = true)
    private Long locationId;

    @Comment("计划出库数量")
    @FormField(title = "计划出库数量", sortNum = "5", grid = true, type = InputType.el_input_number, sort = true)
    private Integer planQuantity;

    @Comment("实际出库数量")
    @FormField(title = "实际出库数量", sortNum = "6", grid = true, type = InputType.el_input_number, sort = true)
    private Integer actualQuantity;

    @Comment("单位售价")
    @FormField(title = "单位售价", sortNum = "7", grid = true, type = InputType.el_input_number)
    @Column(precision = 10, scale = 2)
    private BigDecimal unitPrice;

    @Comment("总金额")
    @FormField(title = "总金额", sortNum = "8", grid = true, type = InputType.el_input_number, sort = true)
    @Column(precision = 10, scale = 2)
    private BigDecimal totalAmount;

    @Comment("批次号")
    @FormField(title = "批次号", sortNum = "9", grid = true)
    @Column(length = 100)
    private String batchNo;

    @Comment("拣货状态")
    @FormField(title = "拣货状态", sortNum = "10", grid = true, type = InputType.select)
    @Column(length = 20)
    private String pickingStatus; // PENDING-待拣货, PROCESSING-拣货中, COMPLETED-已拣货

    @Comment("拣货人ID")
    @FormField(title = "拣货人ID", sortNum = "11", grid = true)
    private Long pickerId;

    @Comment("拣货时间")
    @FormField(title = "拣货时间", sortNum = "12", grid = true, type = InputType.date)
    private Date pickingTime;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "13", type = InputType.richText, col = 23)
    @Column(length = 1000)
    private String note;
} 